#ifndef PLAYER_HH
#define PLAYER_HH
/*
The Player class manages the game's protagonist by handling resources (gold transactions via getGold(), addGold()), 
skill progression (initial base skills, dynamic learning of advanced abilities like DarkPact every 3 victories),
inventory interactions (equipping items, consuming consumables with useItem()), and displaying stats/gold,
enabling strategic customization through equipped skills and items for evolving gameplay.
*/
/*
* Player类管理游戏主角核心系统，实现：
* - 资源管理：通过getGold()/addGold()处理金币交易
* - 技能进阶：
*   * 初始基础技能
*   * 动态学习高阶能力（如每3次胜利习得黑暗契约DarkPact）
* - 背包交互：
*   * 装备道具
*   * 使用消耗品（useItem()）
* - 状态显示：属性值/金币数可视化
* 支持通过装备技能/道具进行战略定制，实现动态玩法演进
*/
#include "Character.hh"
#include <vector>
#include "Skill.hh"

namespace DungeonRPG {

class Player : public Character, public CharacterWithSkills {
private:
    int victoryCount = 0;
    std::vector<std::string> learnedSkillNames;

public:
    Player(const std::string& name, unsigned health, unsigned attack, unsigned defense);
    const std::vector<Item*>& getInventory() const;

    unsigned gold;
    unsigned getGold() const;
    void addGold(unsigned);
    bool spendGold(unsigned);
    void display() const;
    void equipFromInventory(const std::string& name);
    void interact();
    bool useItem(const std::string& itemName);
    bool hasSkill(const std::string& name) const;
    void tryLearnSkill(); // 战斗胜利触发
    void learnSkill(Skill* skill); // 使用卷轴学习
    
};

}

#endif
